const mysql = require('mysql');

// 1.连接
var db =  mysql.createPool({
    host:'localhost',
    user:'root',
    password:'root',
    database:'test'
});

// 2.查询
db.query("SELECT * FROM `test`.`user`",function (err,data) {
    if (err) {
        console.log("Err");
        console.log(err);        
    }else{
        console.log(data);
    }
});

// console.log(db);
